﻿using System;
using HigLabo.Net.Extensions;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class Error : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public String Message { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Int32 Code { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Error(String jsonText)
        {
            var d = this.SetData(jsonText);

            this.Code = d.ToInt32("code") ?? this.Code;
            this.Message = d.ToString("message");
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="msg"></param>
        public Error(Int32 code, String msg)
        {
            this.Code = code;
            this.Message = msg;
        }
    }
}
